<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="#{appBean.baseUrl}resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="#{appBean.baseUrl}resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <title>DocRead Versão 1.0</title>
    </h:head>

    <h:body>
        <!--
                <div id="top" class="ui-widget-header ui-corner-all">
                    <ui:insert name="top">Top</ui:insert>
        
                </div>-->

        <div id="conteiner">
            <div id="menu">

                <h:form> 
                    <p:menubar>
                    <p:menuitem value="Inicio" url="#{appBean.basePath}inicio.xhtml" icon="ui-icon-home" />
                        <p:menuitem value="Upload" url="#{appBean.basePath}upload/upload.xhtml" icon="ui-icon-document" />
                        <!--                    <p:submenu label="Fazer Upload" icon="ui-icon-document">  
                                                <p:submenu label="New" icon="ui-icon-contact">  
                                                    <p:menuitem value="Project" url="#" />  
                                                    <p:menuitem value="Other" url="#" />  
                                                </p:submenu>  
                                                <p:menuitem value="Open" url="#" />  
                                                <p:separator />  
                                                <p:menuitem value="Quit" url="#" />  
                                            </p:submenu>  -->

                        <p:submenu label="Gerenciar" icon="ui-icon-pencil">
                            <p:menuitem value="Usuarios" url="#{appBean.basePath}usuario/index.xhtml"/>
                            <p:separator/>
                            <p:menuitem value ="Documentos" url="#{appBean.basePath}documento/index.xhtml"/>
                        </p:submenu>

<!--                         <p:submenu label="Help" icon="ui-icon-help">   -->
<!--                             <p:menuitem value="Contents" url="#" />   -->
<!--                             <p:submenu label="Search" icon="ui-icon-search">   -->
<!--                                 <p:submenu label="Text">   -->
<!--                                     <p:menuitem value="Workspace" url="#" />   -->
<!--                                 </p:submenu>   -->
<!--                                 <p:menuitem value="File" url="#" />   -->
<!--                             </p:submenu>   -->
<!--                         </p:submenu>   -->

<!--                         <p:submenu label="Actions" icon="ui-icon-gear">   -->
<!--                             <p:submenu label="Ajax" icon="ui-icon-refresh">   -->
<!--                                 <p:menuitem value="Save" actionListener="#{menuBean.save}" icon="ui-icon-disk" />   -->
<!--                                 <p:menuitem value="Update" actionListener="#{menuBean.update}" icon="ui-icon-arrowrefresh-1-w"/>   -->
<!--                             </p:submenu>   -->
<!--                             <p:submenu label="Non-Ajax" icon="ui-icon-newwin">   -->
<!--                                 <p:menuitem value="Delete" actionListener="#{menuBean.delete}" icon="ui-icon-close"  ajax="false"/>   -->
<!--                             </p:submenu>   -->
<!--                         </p:submenu>   -->

                        <!--                    <p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />  -->
                        <p:menuitem value="Sair" actionListener="#{loginBean.logout()}" icon="ui-icon-close" oncomplete="handleLoginRequest(xhr, status, args)"/>  
                    </p:menubar>  


                </h:form>  
            </div>

            <div id="content" class="center_content ui-widget ui-widget-content ui-corner-all">
                <ui:insert name="content">Content</ui:insert>
            </div>

            <div id="bottom" class="ui-widget-header ui-corner-all">
                <div align="center">
                    <ui:insert name="bottom">&copy; 2013 <br></br>Desenvolvido por OCRTeam <br></br></ui:insert>
                </div>

            </div>
        </div>
        <script type="text/javascript">
            function handleLoginRequest(xhr, status, args) {
                if (args.loggetOut) {
                    location.href = args.rota;
                }
            }
        </script> 

    </h:body>

</html>
